########rounding fire scar data to 1km whilst maintaining unique firescar values for distribution modelling############

#set the working directory

setwd ( "G:/phd/PAPER1_Pyrogeography/GIS_DATA/fireweather/")
outdir =  ("G:/phd/PAPER1_Pyrogeography/GIS_DATA/fireweather/outputs")

### load in the txt file.

fs2004 = read.csv ("fire2004xy300m.txt", header = T, sep = ",", dec = ".")
fs2004[1:10,]   #  have a look and see if it worked

names (fs2004) = c("month", "x",  "y")
fs2004$species = "fire"
?names

fs2004a = data.frame(fs2004$species, fs2004$x, fs2004$y, fs2004$month)
fs2004a [1:10,]
fs2004a$year = "2004"
fs2004 = fs2004a
names (fs2004) = c("species", "x", "y", "month", "year")

### round the x y to 0.5 of a degree and add column headings species <fire>, x, y, month <numeric:1 - 12>, year <2004 - 2009>

fs2004$xround = round(fs2004$x / 0.05)* 0.05
fs2004$yround = round(fs2004$y / 0.05)* 0.05

fs2004 [1:500,]

fs2004unique =

?as.unique
